# -*- coding:utf-8 -*-
# @Time : 2021/11/15 14:43
# @Author : zvs
# @File : hn_article
# @Project : untitled
import requests
import json

#执行API调用并存储响应。
url = "https://hacker-news.firebaseio.com/v0/item/19155826.json"
r = requests.get(url)
print(f"Status code: {r.status_code}")

#探索数据的结构。
response_dict = r.json()
readable_file = 'data/readable_hn_data.json'
with open(readable_file, 'w') as f:
    json.dump(response_dict,f,indent=4)
